﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace MallProject.Model
{
    public class News
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string TitlePlain { get; set; }
        public string Image { get; set; }
        public string Description { get; set; }
        public string Content { get; set; }
        public int Status { get; set; }
        public int CreatedBy { get; set; }
        public int ModifiedBy { get; set; }
        public DateTime CreatedDate { get; set; }
        public DateTime ModifiedDate { get; set; }
        public News()
        {

        }
        public News(DataRow dr)
        {
            this.Id = Convert.ToInt32(dr["id"].ToString());
            this.Title = dr["title"].ToString();
            this.TitlePlain = dr["title_plain"].ToString();
            this.Image = dr["image"].ToString();
            this.Description = dr["description"].ToString();
            this.Content = dr["content"].ToString();
            this.Status = Convert.ToInt32(dr["status"].ToString());
            this.CreatedBy = Convert.ToInt32(dr["created_by"].ToString());
            this.ModifiedBy = Convert.ToInt32(dr["modified_by"].ToString());
            this.CreatedDate = Convert.ToDateTime(dr["created_date"].ToString());
            this.ModifiedDate = Convert.ToDateTime(dr["modified_date"].ToString());
        }
    }
}